package com.rivulet.doj_backend.depend;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;

public class DefaultStatus implements Status, Serializable {
    private final int code;
    private final String message;

    public DefaultStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public static DefaultStatus toStatus(int code, String message) {
        return new DefaultStatus(code, message);
    }

    public String toString() {
        return (new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)).append("code", this.code).append("message", this.message).toString();
    }
}
